﻿//-----------------------------------------------------------------------
// <copyright>
// This file is subject to the terms and conditions of the Microsoft Public License (MS-PL).
// See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL for more details.
// </copyright>
//----------------------------------------------------------------------- 
using System.Linq;
using Fulcrum.WeakEventManager;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Fulcrum.UnitTests.WeakEventManager
{
    [TestClass]
    public class WeakEventManagerGenerationDataContextTest
    {
        WeakEventManagerGenerationDataContext context;

        [TestInitialize()]
        public void MyTestInitialize()
        {
            IWeakEventManagerGeneratorConfiguration generatorConfig = MockWemGeneratorConfig.CreateMock();

            this.context = new WeakEventManagerGenerationDataContext(generatorConfig, generatorConfig.WeakEventManagers.ElementAt(0));
        }

        [TestMethod]
        public void TestWemGenerationDataContextCompany()
        {
            Assert.AreEqual("Mock Company", this.context.Company);
        }

        [TestMethod]
        public void TestWemGenerationDataContextCopyright()
        {
            Assert.AreEqual("Mock Copyright", this.context.Copyright);
        }

        [TestMethod]
        public void TestWemGenerationDataContextEventArgsType()
        {
            Assert.AreEqual("MockEventArgsOne", this.context.EventArgsType);
        }

        [TestMethod]
        public void TestWemGenerationDataContextEventName()
        {
            Assert.AreEqual("MockEventNameOne", this.context.EventName);
        }

        [TestMethod]
        public void TestWemGenerationDataContextEventSourceType()
        {
            Assert.AreEqual("MockEventSourceOne", this.context.EventSourceType);
        }

        [TestMethod]
        public void TestWemGenerationDataContextManagerName()
        {
            Assert.AreEqual("MockNameOne", this.context.ManagerName);
        }

        [TestMethod]
        public void TestWemGenerationDataContextName()
        {
            Assert.AreEqual("MockNameOne", this.context.Name);
        }

        [TestMethod]
        public void TestWemGenerationDataContextNamespace()
        {
            Assert.AreEqual("Mock.Namespace", this.context.Namespace);
        }
        
        [TestMethod]
        public void TestWemGenerationDataContextOutputFileName()
        {
            Assert.AreEqual("MockNameOne.Generated", this.context.OutputFileName);
        }

        [TestMethod]
        public void TestWemGenerationDataContextOutputPath()
        {
            Assert.AreEqual("", this.context.OutputPath);
        }

        [TestMethod]
        public void TestWemGenerationDataContextTemplateFileName()
        {
            Assert.AreEqual("WeakEventManager.t4", this.context.TemplateFileName);
        }
    }
}
